<!doctype html>
<html lang="zh_cn" itemscope itemtype="http://schema.org/Person">
<head>
                <meta charset="utf-8">
        <!-- Site Meta Data -->
        <title>一个程序员的简单生活 - 布丁缘</title>
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="description" content="技术博客,涉及Java/PHP/Python/Javascript等,聊聊程序,聊聊生活,聊聊事实,聊聊育儿">
        <meta name="keywords" content="编码经验,技术分享,生活积累,实事评说">
        <meta name="author" content="布丁缘">

        <link rel="shortcut icon" href="">

        <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,600,700' rel='stylesheet' type='text/css'>
        <!-- Style Meta Data -->
        <link rel="stylesheet" href="https://www.ddkiss.com/theme/css/style.css" type="text/css"/>
        <link rel="stylesheet" href="https://www.ddkiss.com/theme/css/pygments.css" type="text/css"/>

        <!-- Feed Meta Data -->
            <link href="https://www.ddkiss.com/feeds/all.atom.xml" type="application/atom+xml" rel="alternate"
                  title="一个程序员的简单生活 ATOM Feed"/>



</head>

<body>
<!-- Sidebar -->
<aside>
    <center><h1><a href="/" style="color:#fff"><img id="avatar" src="/images/avatar.jpg"></a></h1></center>
        <p>一个程序员的简单生活</p>
    <br>
    <nav class="nav">
        <ul class="list-bare">
                <li><a class="nav__link" href="https://www.ddkiss.com/category/chang-yong-ji-qiao.html">常用技巧</a></li>
                <li><a class="nav__link" href="https://www.ddkiss.com/category/kai-fa-huan-jing.html">开发环境</a></li>
                <li><a class="nav__link" href="https://www.ddkiss.com/category/sheng-huo-dian-di.html">生活点滴</a></li>

                <li><a class="nav__link" href="/pages/books.html">书单</a></li>
                <li><a class="nav__link" href="/pages/movies.html">影单</a></li>
                <li><a class="nav__link" href="/pages/downloads.html">下载</a></li>
                <li><a class="nav__link" href="/pages/about.html">关于我</a></li>


        </ul>
    </nav>


    <form>
      <input type="text"  id="bdcsMain"/>
    </form>

</aside>

<!-- Content -->
<article>
  <main>
    <nav>
      <a href="/">首页</a>
      <a href="/archives.html">归档</a>
      <a href="/categories.html">分类</a>
      <a href="/tags.html">标签</a>
      <a href="/pages/about.html">关于我</a>
    </nav>
  </main>
        <ol>
    <h2 class="latest">Author: 布丁缘</h2>
                <li class="post_list"><p class="post_entry">
                    <h2 class="post_title"><a href="https://www.ddkiss.com/archives/64.html" rel="bookmark"
                                              title="Permalink to Hihocode #1015 : KMP算法">Hihocode #1015 : KMP算法</a>
                    </h2>
                    <span>作者：</span><a href="https://www.ddkiss.com/author/bu-ding-yuan.html">布丁缘</a>
                    <span class="post_category">分类：<a href="https://www.ddkiss.com/category/kai-fa-huan-jing.html" rel="bookmark"
                                                   title="Permalink to 开发环境">开发环境</a></span>
                    <span class="post_date">  时间：2017-10-16 17:41:00</span>

                        <p>做了一道KMP相关的题，求解字符串中指定子串出现的次数。http://hihocoder.com/problemset/problem/1015 思路 KMP算法是匹配到子串后(j&gt;=pattern.length)就返回了。本例则是匹配成功后，执行计数+回溯。Hihocode有现成的测试用例，方便进行代码检查。 代码 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 …</p>

                </li>
                <li class="post_list"><p class="post_entry">
                    <h2 class="post_title"><a href="https://www.ddkiss.com/archives/61.html" rel="bookmark"
                                              title="Permalink to KMP算法之next数组求解说明">KMP算法之next数组求解说明</a>
                    </h2>
                    <span>作者：</span><a href="https://www.ddkiss.com/author/bu-ding-yuan.html">布丁缘</a>
                    <span class="post_category">分类：<a href="https://www.ddkiss.com/category/kai-fa-huan-jing.html" rel="bookmark"
                                                   title="Permalink to 开发环境">开发环境</a></span>
                    <span class="post_date">  时间：2017-10-13 16:32:00</span>

                        <p>最近看了太多篇KMP算法的文章和书籍了，也只能是说理解了那段代码。网上有很多kmp算法的介绍，整个过程的推导都有。唯独对求解next数组，单独一篇博客能讲清楚的比较少，特别是能帮助初学者理解的不多。下面我来写下，哪些对我理解next求解过程有意义的博客。大部分内容来自引用。 站在巨人的肩膀上 下面由浅入深看下next数组如何求解 1. 阮一峰的字符串匹配的 KMP 算法 将整个匹配过程画出来了，方便直观理解kmp匹配过程。可惜，看完了图片你去看下代码？绝对让你一脸茫然。 2. 从头到尾理解KMP 朴素匹配算法时看过，文章看着挺累，没能坚持看完。不适合一上来就看，容易睡着。 3. KMP算法的next数组详解 这个图才让我真正明白next[j]=k中next[j](距离)和k(索引)的真正含义。不懂的直接去看原文吧。需要注意的是有下面几点： 求解next数组过程是已知 next[j]=k，求解 …</p>

                </li>
                <li class="post_list"><p class="post_entry">
                    <h2 class="post_title"><a href="https://www.ddkiss.com/archives/60.html" rel="bookmark"
                                              title="Permalink to KMP算法前传之朴素匹配算法回溯位置计算详解Java版">KMP算法前传之朴素匹配算法回溯位置计算详解Java版</a>
                    </h2>
                    <span>作者：</span><a href="https://www.ddkiss.com/author/bu-ding-yuan.html">布丁缘</a>
                    <span class="post_category">分类：<a href="https://www.ddkiss.com/category/kai-fa-huan-jing.html" rel="bookmark"
                                                   title="Permalink to 开发环境">开发环境</a></span>
                    <span class="post_date">  时间：2017-10-12 14:39:00</span>

                        <p>KMP算法是由朴素匹配算法优化而来的。最近，重新了解朴素匹配算法，发现网上的文章对于i的回溯没有讲得很清楚，比如从头到尾彻底理解KMP中提到的如果失配（即S[i]! = P[j]），令i = i - (j - 1)，j = 0，当时看到的时候没想明白为啥？另外，有的书都是以i=1,j=1开始，有的书是以i=0,j=0开始，这两种方式是有区别的。特别是回溯i时。 朴素匹配算法，网上有很多介绍。为了方便，下面约定如下：原串为s,位置为i，待匹配串为p，位置为j。如果s …</p>

                </li>
                <li class="post_list"><p class="post_entry">
                    <h2 class="post_title"><a href="https://www.ddkiss.com/archives/58.html" rel="bookmark"
                                              title="Permalink to 测试百度统计和友盟统计对HTTPS的支持">测试百度统计和友盟统计对HTTPS的支持</a>
                    </h2>
                    <span>作者：</span><a href="https://www.ddkiss.com/author/bu-ding-yuan.html">布丁缘</a>
                    <span class="post_category">分类：<a href="https://www.ddkiss.com/category/kai-fa-huan-jing.html" rel="bookmark"
                                                   title="Permalink to 开发环境">开发环境</a></span>
                    <span class="post_date">  时间：2017-10-11 16:55:00</span>

                        <p>昨天配好了HTTPS，今天上来一看，小绿标不见了。F12查看了之后发现，是友盟(CNZZ)搞的鬼。 A Parser-blocking, cross site (i.e. different eTLD+1) script, http://c.cnzz.com/core.php?web_id=126457036&amp;t=z, is invoked via document.write. The network request for this script MAY be blocked by the browser in this or a future page …</p>

                </li>
                <li class="post_list"><p class="post_entry">
                    <h2 class="post_title"><a href="https://www.ddkiss.com/archives/57.html" rel="bookmark"
                                              title="Permalink to Vue 报错Avoid using non-primitive value as key, use string/number value instead">Vue 报错Avoid using non-primitive value as key, use string/number value instead</a>
                    </h2>
                    <span>作者：</span><a href="https://www.ddkiss.com/author/bu-ding-yuan.html">布丁缘</a>
                    <span class="post_category">分类：<a href="https://www.ddkiss.com/category/kai-fa-huan-jing.html" rel="bookmark"
                                                   title="Permalink to 开发环境">开发环境</a></span>
                    <span class="post_date">  时间：2017-10-11 14:17:00</span>

                        <p>今天看到 Vue 下有一个warn报错，具体如下。 [Vue warn]: Avoid using non-primitive value as key, use string/number value instead. found in ---&gt; &lt;ConsoleSidebar&gt; at /home/iview-more/src/views/components/layout/sidebar.vue &lt;Index&gt; at /home/iview-more/src/views/index.vue &lt;App&gt; at /home/iview-more/src/app.vue &lt;Root&gt; warn …</p>

                </li>
                <li class="post_list"><p class="post_entry">
                    <h2 class="post_title"><a href="https://www.ddkiss.com/archives/56.html" rel="bookmark"
                                              title="Permalink to Git如何初始化到已存在的项目中">Git如何初始化到已存在的项目中</a>
                    </h2>
                    <span>作者：</span><a href="https://www.ddkiss.com/author/bu-ding-yuan.html">布丁缘</a>
                    <span class="post_category">分类：<a href="https://www.ddkiss.com/category/kai-fa-huan-jing.html" rel="bookmark"
                                                   title="Permalink to 开发环境">开发环境</a></span>
                    <span class="post_date">  时间：2017-10-10 18:24:00</span>

                        <p>如何把新建的空的git项目配置到已有的项目里呢？ git init git remote add origin git@gitee.com:whusl/sblog.git git pull -u origin master git add . git commit -m &#39;init&#39; git push -u orgin master 第三步 pull操作可以用git fetch替代。</p>

                </li>
                <li class="post_list"><p class="post_entry">
                    <h2 class="post_title"><a href="https://www.ddkiss.com/archives/55.html" rel="bookmark"
                                              title="Permalink to 阿里云ECS免费 https 证书申请和 nginx 配置">阿里云ECS免费 https 证书申请和 nginx 配置</a>
                    </h2>
                    <span>作者：</span><a href="https://www.ddkiss.com/author/bu-ding-yuan.html">布丁缘</a>
                    <span class="post_category">分类：<a href="https://www.ddkiss.com/category/kai-fa-huan-jing.html" rel="bookmark"
                                                   title="Permalink to 开发环境">开发环境</a></span>
                    <span class="post_date">  时间：2017-10-10 16:06:00</span>

                        <p>全名上云的时代大家都争相启用HTTPS，我也不免俗。好在阿里云提供了免费的CA证书，这便宜不占？！ 申请 点击购买证书 确认订单。 完成信息补全后等待审核。阿里云会自动在DNS解析里加上一条TXT记录，注意要暂停所有CNAME解析。 然后就可以看到状态为已签发。选择Nginx配置，下载证书。吐槽下，我是晚上申请的，但是第二天早上都还在审核中。中午重写配置了DNS解析，撤回。再申请，没过一会儿，刷新页面就发现签发了。不知为何…… Nginx配置 将下载的证书zip包解压到nginx目录下cert文件夹中(自己新建文件夹)。然后配置443端口信息。 server { listen 443 ssl http2; ssl_certificate cert/2142887522***28.pem; ssl_certificate_key cert/2142887522***28.key; ssl_session_timeout 5m; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE …</p>

                </li>
                <li class="post_list"><p class="post_entry">
                    <h2 class="post_title"><a href="https://www.ddkiss.com/archives/45.html" rel="bookmark"
                                              title="Permalink to 用 dig 或 nslookup 命令查询txt解析记录">用 dig 或 nslookup 命令查询txt解析记录</a>
                    </h2>
                    <span>作者：</span><a href="https://www.ddkiss.com/author/bu-ding-yuan.html">布丁缘</a>
                    <span class="post_category">分类：<a href="https://www.ddkiss.com/category/kai-fa-huan-jing.html" rel="bookmark"
                                                   title="Permalink to 开发环境">开发环境</a></span>
                    <span class="post_date">  时间：2017-10-10 11:48:00</span>

                        <p>这几天想把HTTPS装上，阿里云的免费证书需要在域名解析的地方添加TXT记录。文档里用的是dig命令，我本地装了nslookup。试验下如何用咯。 dig命令 dig用法很多，这里只使用dig txt blog.xxx.com @8.8.8.8 校验是否添加了txt记录 sang@sang-ssd:~$ dig txt blog.xxx.com @8.8.8.8 ; &lt;&lt;&gt;&gt; DiG 9.9.5-3ubuntu0.4-Ubuntu &lt;&lt;&gt;&gt; txt blog.xxx.com @8.8.8.8 ;; global options: +cmd ;; Got …</p>

                </li>
                <li class="post_list"><p class="post_entry">
                    <h2 class="post_title"><a href="https://www.ddkiss.com/archives/44.html" rel="bookmark"
                                              title="Permalink to Linux下查找并杀死 zombile 和 stopped 进程">Linux下查找并杀死 zombile 和 stopped 进程</a>
                    </h2>
                    <span>作者：</span><a href="https://www.ddkiss.com/author/bu-ding-yuan.html">布丁缘</a>
                    <span class="post_category">分类：<a href="https://www.ddkiss.com/category/kai-fa-huan-jing.html" rel="bookmark"
                                                   title="Permalink to 开发环境">开发环境</a></span>
                    <span class="post_date">  时间：2017-10-10 11:36:00</span>

                        <p>用top命令查看系统运行情况，突然发现stopped和zombile进程个数居然不是0。 [root@myos software]# top top - 11:20:17 up 60 days, 17:15, 3 users, load average: 0.01, 0.02, 0.84 Tasks: 91 total, 1 running, 86 sleeping, 3 stopped, 1 zombie %Cpu(s): 0.3 us, 0.3 sy, 0.0 …</p>

                </li>
                <li class="post_list"><p class="post_entry">
                    <h2 class="post_title"><a href="https://www.ddkiss.com/archives/43.html" rel="bookmark"
                                              title="Permalink to Apache ab测试报 'ab: invalid URL' 错误">Apache ab测试报 'ab: invalid URL' 错误</a>
                    </h2>
                    <span>作者：</span><a href="https://www.ddkiss.com/author/bu-ding-yuan.html">布丁缘</a>
                    <span class="post_category">分类：<a href="https://www.ddkiss.com/category/kai-fa-huan-jing.html" rel="bookmark"
                                                   title="Permalink to 开发环境">开发环境</a></span>
                    <span class="post_date">  时间：2017-10-10 11:12:00</span>

                        <p>今天用apache2自带的ab性能压测工具对自己的网站进行了简单的测试。看了下说明，照着例子试了下，居然不行。 报错如下： sa@san:~/software/apache2/bin$ ./ab http://www.baidu.com ./ab: invalid URL Usage: ./ab [options] [http://]hostname[:port]/path Options are: -n requests Number of requests to perform -c concurrency Number of multiple requests to make -t timelimit Seconds to max. wait for responses …</p>

                </li>
        </ol>

    <p class="paginator">
                <a href="https://www.ddkiss.com/author/bu-ding-yuan.html">~:)</a>
        2 ~ 4
            <a href="https://www.ddkiss.com/author/bu-ding-yuan3.html">(:~</a>
    </p>

</article>

<!-- Footer -->
    <footer>
        <p> &copy;2017-2020&nbsp;<a href="http://www.miitbeian.gov.cn/" target="_blank">鄂ICP备17020200号</a>
          Blog powered by <a href="http://getpelican.com/">Pelican</a>
        </p>
    </footer>

    <!-- Analytics -->
    <script>
      var _hmt = _hmt || [];
      (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?88c55edaf311dbacac56a16316b04c8b";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
      })();
    </script>

<script type="text/javascript">(function(){document.write(unescape('%3Cdiv id="bdcs"%3E%3C/div%3E'));var bdcs = document.createElement('script');bdcs.type = 'text/javascript';bdcs.async = true;bdcs.src = 'http://znsv.baidu.com/customer_search/api/js?sid=14490611060029767912' + '&plate_url=' + encodeURIComponent(window.location.href) + '&t=' + Math.ceil(new Date()/3600000);var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(bdcs, s);})();</script>

</body>
</html>